/*
**      Newton Developer Technical Support Sample Code
**
**      PictIndex
**
**      by Maurice Sharp, Newton Developer Technical Support
**
**      Copyright  1993-1995 by Apple Computer, Inc.  All rights reserved.
**
**      You may incorporate this sample code into your applications without
**      restriction.  This sample code has been provided "AS IS" and the
**      responsibility for its operation is 100% yours.  You are not
**      permitted to modify and redistribute the source as "DTS Sample Code."
**      If you are going to re-distribute the source, we require that you
**      make it clear in the source that the code was descended from
**      Apple-provided sample code, but that you've made changes.
*/


PictIndex

This sample shows the basics of the protoPictIndexer proto, which makes a simple array of pictures which are selectable.

How to make the picture:
I used a drawing package to draw a square object, then duplicated out 3 things and aligned them equally spaced. Then the old copy and paste into a PICT item in ResEdit. I used the Template editor to find the bounds of the PICT (NOTE, the bounds are Top Left Bottom Right). A little subtraction gives you the bounds of the PICT (20 heigh by 95 wide). Of course doing this means the hiliting on the Square and Triangle do not look nice. So I just expanded the coordinates by 5 pixels in each direction. That is how I got the iconBBox rectangle.

NOTE: I could have done a better job in the drawing package and given a nice white border on each side of the larger PICT.

Using the protoPictIndex:
Updating the text item is easy, just look at the indexClickScript. Getting the initial value in the text item is done from the viewSetupFormScript in the protoPictIndexer, take a look, a nice example of re-use.

The strings for the text item are in the protoApp (myBase), look for shapeArray.

Maurice Sharp
PIE/DTS

